<template>
  <div>
    <p>请选择你喜欢的专栏</p>
    <input v-model="arr" @click="xr" type="checkbox" value="科幻">科幻
    <input v-model="arr" @click="xr" type="checkbox" value="喜剧">喜剧
    <input v-model="arr" @click="xr" type="checkbox" value="动漫">动漫
    <input v-model="arr" @click="xr" type="checkbox" value="冒险">冒险
    <input v-model="arr" @click="xr" type="checkbox" value="科技">科技
    <input v-model="arr" @click="xr" type="checkbox" value="军事">军事
    <input v-model="arr" @click="xr" type="checkbox" value="娱乐">娱乐
    <input v-model="arr" @click="xr" type="checkbox" value="奇闻">奇闻
    <ul>
      
    </ul>
  </div>
</template>

<script>
export default {
  data (){
    return {
      // 用数组接收
      arr:[]
    }
  },
  methods: {
    xr(){
      setTimeout(()=>{
        document.querySelector('ul').innerHTML = ''
      for (let i = 0; i<this.arr.length; i++){
        let li = document.createElement("li")
        li.innerText=this.arr[i]
        document.querySelector('ul').appendChild(li)
      } 
      },20)
       
    }
}
}
</script>